package com.googlecode.pkchat.pkserver;

import java.util.*;
import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.awt.event.*;

import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;


/***
 *
 * @author Sunmoon Kim
 *
 */
public class ServerGUI {
    private JFrame frame;

    private JButton startButton;
    private JButton stopButton;

    private JButton removeButton;

    private JLabel port;
    private JTextField porttext;

    private JList list;

    /*
     * Method to create Window
     */

    public void CreateWindow()
    {
	frame = new JFrame("ServerGUI");
	frame.setBounds(200, 200, 650, 600);
	frame.setVisible(true);
	Container pane = frame.getContentPane();
	pane.setLayout(new BorderLayout());

	port = new JLabel();
	porttext = new JTextField();



	// Paste a panel by GridLayout

	list = new JList();
	list.addListSelectionListener(new ListListener());

	JPanel northPanel = new JPanel(new GridLayout(4, 1));
	JPanel southPanel = new JPanel(new GridLayout(1, 1));
	Border buttonEdge = BorderFactory.createRaisedBevelBorder();
	porttext = new JTextField();

	startButton = new JButton("START");
	startButton.setBorder(buttonEdge);
	startButton.addActionListener(new ButtonListener());
	northPanel.add(startButton);

	stopButton = new JButton("STOP");
	stopButton.setBorder(buttonEdge);
	stopButton.addActionListener(new ButtonListener());
	northPanel.add(stopButton);

	removeButton = new JButton("REMOVE");
	removeButton.setBorder(buttonEdge);
	removeButton.addActionListener(new ButtonListener());
	southPanel.add(removeButton);

	pane.add(northPanel, BorderLayout.NORTH);
	pane.add(southPanel, BorderLayout.SOUTH);

	frame.setVisible(true);
    }

    class ListListener implements ListSelectionListener {
	public void valueChanged(ListSelectionEvent e) {
	}
    }

    public class ButtonListener implements ActionListener {
	public void actionPerformed(ActionEvent e) {
	    if (e.getSource() == startButton)
	    {

	    }
	    else if (e.getSource() == stopButton)
	    {

	    }
	    else if (e.getSource() == removeButton)
	    {

	    }

	    public static void main(String[] args) {
		ServerGUI s = new ServerGUI();
	    }

	}
